#include<bits/stdc++.h> 

using namespace std;
typedef long long ll;
ll t;
bool cmp(const ll& a,const ll& b){
	return a>b;
}
int main(){
	cin>>t;
	while(t--){
		ll n,c;
		cin>>n>>c;
		double p=c;
		ll ans=0;
		vector<ll> arr;
		for (int i=1;i<=n;i++){
			ll x;
			cin>>x;
			arr.push_back(x);
		}
		sort(arr.begin(),arr.end(),cmp);
		for (int i=0;i<n;i++){
			if(arr[i]<=p){
				ans++;
				p/=2.0;
			}
		}
		cout<<n-ans<<endl;
//		for (auto& x:arr){
//			cout<<x<<" ";
//		}
//		cout<<endl;
	}
	return 0;
} 
